package com.rb.util.sms;

import java.util.Properties;

public class SMSFactory {
	private static volatile SMSInterface smsClient;
	private static Properties props = new Properties();

	public static void setUrl(String url) {
		props.put("url", url);
	}

	public static void setCharset(String charset) {
		props.put("charset", charset);
	}

	public static void setUid(String uid) {
		props.put("uid", uid);
	}

	public static void setKey(String key) {
		props.put("key", key);
	}

	public SMSInterface createSmsClient() {
		if (smsClient == null) {
			synchronized (SMSUtil.class) {
				if (smsClient == null) {
					smsClient = new SMSUtil(props);
				}
			}
		}
		return smsClient;
	}
}
